import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';


class ResultDialog{


  show(success,fail,callback){
    Get.defaultDialog(
      title: "",
      barrierDismissible: false,
      contentPadding:EdgeInsets.zero,
      titlePadding:EdgeInsets.zero,
      backgroundColor: Colors.transparent,
      content: Container(
          width: 260.w,
          height: 147.h,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.all(Radius.circular(8.r)),
          ),
          child: Stack(
            alignment: AlignmentDirectional.center,
            children: [
              Positioned(
                  top: 16.h,
                  child:   Text('借阅结果',style: TextStyle(color: Colors.blueAccent,fontSize: 12.sp)),
              ),
              Positioned(
                right: 15.w,
                top: 10.h,
                child:  InkWell(
                  onTap: (){
                    callback();
                    Get.back();
                  },
                  child: Image.asset("assets/images/close.png",width: 12.w,fit: BoxFit.fitWidth,),
              )),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text('成功$success本',style: TextStyle(color: Colors.blueAccent,fontSize: 14.sp),),
                  Text(' 失败$fail本',style: TextStyle(color: Colors.red,fontSize: 14.sp),),
                ],
              ),
              Positioned(
                bottom:16.h,
                child:InkWell(
                  onTap: (){
                    callback();
                    Get.back();
                  },
                  child: Image.asset("assets/images/result_confirm.png",width: 100.w,fit: BoxFit.fitWidth,),
                )
              )
            ],
          )
      ),
    );
  }
}